/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WebServerDialog.java
 *
 * Created on 20.05.2010, 12:52:45
 */
package webserver;

import java.awt.AWTException;
import java.awt.Font;
import java.awt.Image;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.filechooser.FileFilter;

/**
 * @author Lars
 */
public class WebServerDialog extends javax.swing.JDialog {

	private static AppProperties properties;

	/** Creates new form WebServerDialog
	 * @param parent
	 * @param modal 
	 */
	public WebServerDialog(java.awt.Frame parent, boolean modal) {
		super(parent, modal);
		initComponents();
		FileFilter folderFilter = new FileFilter() {

			public String getDescription() {
				return "Ordner";
			}

			public boolean accept(File pathname) {
				return pathname.isDirectory();
			}
		};
		chooser = new JFileChooser();
		chooser.setFileFilter(folderFilter);
		chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		jtfDomain.setText(properties.getDefaultDomain());
		jtfHomeDirectory.setText(properties.getHomeDirectory());
		jtfErrorDirectory.setText(properties.getErrorDirectory());
		jtfPort.setText(properties.getPort() + "");
		jsCacheManagementInterval.setValue(properties.getCacheManagementInterval() / 1000);
		jsKeepAliveWaitInterval.setValue(properties.getKeepAliveWaitInterval() / 1000);
		jsResponseThreadCount.setValue(properties.getResponseThreadCount());

		Image image = Toolkit.getDefaultToolkit().getImage(properties.getHomeDirectory() + "/trayicon.png");

		PopupMenu popup = new PopupMenu();
		MenuItem anzeigen = new MenuItem("Ausblenden");
		anzeigen.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				dialog.setVisible(false);
			}
		});
		MenuItem ende = new MenuItem("Ende");
		ende.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				jbtSchliessenActionPerformed(e);
			}
		});
		popup.add(anzeigen);
		popup.addSeparator();
		popup.add(ende);

		TrayIcon trayIcon = new TrayIcon(image, "Web Server", popup);
		trayIcon.setImageAutoSize(true);
		trayIcon.addMouseListener(new MouseListener() {

			public void mouseClicked(MouseEvent e) {
				dialog.setVisible(true);
				dialog.toFront();
			}

			public void mousePressed(MouseEvent e) {
				// ignore
			}

			public void mouseReleased(MouseEvent e) {
				// ignore
			}

			public void mouseEntered(MouseEvent e) {
				// ignore
			}

			public void mouseExited(MouseEvent e) {
				// ignore
			}
		});
		try {
			SystemTray.getSystemTray().add(trayIcon);
		} catch (AWTException ex) {
			//ignore
		}
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException ex) {
			//ignore
		} catch (InstantiationException ex) {
			//ignore
		} catch (IllegalAccessException ex) {
			//ignore
		} catch (UnsupportedLookAndFeelException ex) {
			//ignore
		}
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jtfDomain = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jtfHomeDirectory = new javax.swing.JTextField();
        jbtBrowseHomeDirectory = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jtfErrorDirectory = new javax.swing.JTextField();
        jbtBrowseErrorDirectory = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jtfPort = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jsCacheManagementInterval = new javax.swing.JSpinner();
        jLabel4 = new javax.swing.JLabel();
        jsKeepAliveWaitInterval = new javax.swing.JSpinner();
        jLabel5 = new javax.swing.JLabel();
        jsResponseThreadCount = new javax.swing.JSpinner();
        jbtSpeichern = new javax.swing.JButton();
        jbtStarten = new javax.swing.JButton();
        jbtStoppen = new javax.swing.JButton();
        jbtSchliessen = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jScrollPane1.setPreferredSize(new java.awt.Dimension(600, 350));

        jPanel1.setMinimumSize(new java.awt.Dimension(400, 200));
        jPanel1.setPreferredSize(new java.awt.Dimension(400, 240));

        jLabel6.setFont(standard);
        jLabel6.setText("Domain (only HTTP1.0):");

        jtfDomain.setFont(standard);

        jLabel1.setFont(standard);
        jLabel1.setText("Home Directory:");

        jtfHomeDirectory.setFont(standard);

        jbtBrowseHomeDirectory.setFont(standard);
        jbtBrowseHomeDirectory.setText("Durchsuchen");
        jbtBrowseHomeDirectory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtBrowseHomeDirectoryActionPerformed(evt);
            }
        });

        jLabel7.setFont(standard);
        jLabel7.setText("Error Directory:");

        jtfErrorDirectory.setFont(standard);

        jbtBrowseErrorDirectory.setFont(standard);
        jbtBrowseErrorDirectory.setText("Durchsuchen");
        jbtBrowseErrorDirectory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtBrowseErrorDirectoryActionPerformed(evt);
            }
        });

        jLabel2.setFont(standard);
        jLabel2.setText("Port:");

        jtfPort.setFont(standard);
        jtfPort.setText("8080");

        jLabel3.setFont(standard);
        jLabel3.setText("Cache Management Interval (s):");

        jsCacheManagementInterval.setFont(standard);

        jLabel4.setFont(standard);
        jLabel4.setText("Keep-Alive wait Interval (s):");

        jsKeepAliveWaitInterval.setFont(standard);

        jLabel5.setFont(standard);
        jLabel5.setText("Response Thread count:");

        jsResponseThreadCount.setFont(standard);

        jbtSpeichern.setFont(standard);
        jbtSpeichern.setText("Speichern");
        jbtSpeichern.setToolTipText("Speichern");
        jbtSpeichern.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtSpeichernActionPerformed(evt);
            }
        });

        jbtStarten.setFont(standard);
        jbtStarten.setText("Starten");
        jbtStarten.setToolTipText("Starten");
        jbtStarten.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtStartenActionPerformed(evt);
            }
        });

        jbtStoppen.setFont(standard);
        jbtStoppen.setText("Stoppen");
        jbtStoppen.setToolTipText("Stoppen");
        jbtStoppen.setEnabled(false);
        jbtStoppen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtStoppenActionPerformed(evt);
            }
        });

        jbtSchliessen.setFont(standard);
        jbtSchliessen.setText("Beenden");
        jbtSchliessen.setToolTipText("Beenden");
        jbtSchliessen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtSchliessenActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jbtSpeichern)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtStarten)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtStoppen)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtSchliessen))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfDomain, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jtfErrorDirectory, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
                                    .addComponent(jtfHomeDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jbtBrowseErrorDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jbtBrowseHomeDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jsResponseThreadCount, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jsKeepAliveWaitInterval, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jsCacheManagementInterval, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfPort, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfDomain, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfHomeDirectory, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtBrowseHomeDirectory))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfErrorDirectory, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtBrowseErrorDirectory))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jsCacheManagementInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jsKeepAliveWaitInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jsResponseThreadCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtSpeichern)
                    .addComponent(jbtStarten)
                    .addComponent(jbtStoppen)
                    .addComponent(jbtSchliessen))
                .addContainerGap())
        );

        jScrollPane1.setViewportView(jPanel1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void jbtBrowseHomeDirectoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtBrowseHomeDirectoryActionPerformed
		String path = System.getProperty("user.dir");
		if (!jtfHomeDirectory.getText().equals("")) {
			path = jtfHomeDirectory.getText();
		}
		if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
			path = chooser.getSelectedFile().getPath();
		}
		jtfHomeDirectory.setText(path);
}//GEN-LAST:event_jbtBrowseHomeDirectoryActionPerformed

	private void jbtSpeichernActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtSpeichernActionPerformed
		properties.setDefaultDomain(jtfDomain.getText());
		properties.setHomeDirectory(jtfHomeDirectory.getText());
		properties.setErrorDirectory(jtfErrorDirectory.getText());
		int port = 8080;
		try {
			port = Integer.parseInt(jtfPort.getText());
		} catch (NumberFormatException ex) {
			port = 8080;
		}
		properties.setPort(port);
		properties.setCacheManagementInterval(((Integer) jsCacheManagementInterval.getValue()) * 1000);
		properties.setKeepAliveWaitInterval(((Integer) jsKeepAliveWaitInterval.getValue()) * 1000);
		properties.setResponseThreadCount(((Integer) jsResponseThreadCount.getValue()));
		properties.save();
}//GEN-LAST:event_jbtSpeichernActionPerformed

	private void jbtStartenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtStartenActionPerformed
		jbtSpeichernActionPerformed(evt);
		server = new Server();
		server.start();
		jbtSpeichern.setEnabled(false);
		jbtStarten.setEnabled(false);
		jbtStoppen.setEnabled(true);
		this.setVisible(false);
}//GEN-LAST:event_jbtStartenActionPerformed

	private void jbtStoppenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtStoppenActionPerformed
		if(server != null) {
			server.finish();
		}
		jbtSpeichern.setEnabled(true);
		jbtStarten.setEnabled(true);
		jbtStoppen.setEnabled(false);
}//GEN-LAST:event_jbtStoppenActionPerformed

	private void jbtSchliessenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtSchliessenActionPerformed
		jbtStoppenActionPerformed(evt);
		//server.finish();
		System.exit(0);
}//GEN-LAST:event_jbtSchliessenActionPerformed

	private void jbtBrowseErrorDirectoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtBrowseErrorDirectoryActionPerformed
		String path = System.getProperty("user.dir");
		if (!jtfErrorDirectory.getText().equals("")) {
			path = jtfErrorDirectory.getText();
		}
		if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
			path = chooser.getSelectedFile().getPath();
		}
		jtfErrorDirectory.setText(path);
	}//GEN-LAST:event_jbtBrowseErrorDirectoryActionPerformed

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		properties = AppProperties.getInstance();

		java.awt.EventQueue.invokeLater(new Runnable() {

			public void run() {
				if (dialog == null) {
					dialog = new WebServerDialog(new javax.swing.JFrame(), true);
				}
				dialog.addWindowListener(new java.awt.event.WindowAdapter() {

					@Override
					public void windowClosing(java.awt.event.WindowEvent e) {
						//System.exit(0);
					}
				});
				dialog.setTitle("WebServer");
				dialog.setVisible(true);
			}
		});
	}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbtBrowseErrorDirectory;
    private javax.swing.JButton jbtBrowseHomeDirectory;
    private javax.swing.JButton jbtSchliessen;
    private javax.swing.JButton jbtSpeichern;
    private javax.swing.JButton jbtStarten;
    private javax.swing.JButton jbtStoppen;
    private javax.swing.JSpinner jsCacheManagementInterval;
    private javax.swing.JSpinner jsKeepAliveWaitInterval;
    private javax.swing.JSpinner jsResponseThreadCount;
    private javax.swing.JTextField jtfDomain;
    private javax.swing.JTextField jtfErrorDirectory;
    private javax.swing.JTextField jtfHomeDirectory;
    private javax.swing.JTextField jtfPort;
    // End of variables declaration//GEN-END:variables
	private static WebServerDialog dialog = null;
	private final Font standard = new Font("Verdana", Font.PLAIN, 10);
	private static Server server = null;
	private static JFileChooser chooser = null;
}
